<?php

//Route::group(['middleware' => 'wechat.oauth'], function () {
    Route::get('/', 'ApplicationController@home');
    Route::get('/objects', 'ApplicationController@objects');
    Route::get('/objects/{id}/{period}', 'ApplicationController@objectsDetail');
    Route::get('/orders/hold', 'ApplicationController@ordersHold');
    Route::get('/orders/history', 'ApplicationController@ordersHistory');
    Route::get('/orders/detail/{id}', 'ApplicationController@ordersDetail');
    Route::get('/account', 'ApplicationController@account');

    Route::get('/account/inviteqrcode', 'ApplicationController@inviteqrcode');//邀请二维码页面
    Route::get('/account/invite/{code}', 'ApplicationController@invite');//处理邀请页面
    Route::get('/account/myinvites', 'ApplicationController@myinvites');//我的邀请人列表
    Route::get('/account/myBusiness', 'ApplicationController@myBusiness');//我的会员交易明细

    Route::get('/account/contract', 'ApplicationController@contract');//注册条款页面
    Route::get('/account/stepone', 'ApplicationController@stepone');//注册条款页面
    Route::any('/account/bind', 'ApplicationController@accountBind');
    //Route::any('/account/pay', 'ApplicationController@accountPay'); //这个充值函数是好的  只不过是用的不同的公司的api 是别人的帐号 注释掉留着
    Route::any('/account/pay', 'ApplicationController@accountPayNew');
//    Route::any('/account/pay',function(){return "充值功能正在调试";});//测试中
    Route::any('/account/paySure', 'ApplicationController@accountPayNewSure');

    Route::get('/account/pay/staff', 'ApplicationController@accountPayStaff');
    Route::get('/account/withdraw/records', 'ApplicationController@accountWithdrawRecords');
    Route::any('/account/withdraw', 'ApplicationController@accountWithdraw');
    Route::get('/account/records', 'ApplicationController@accountRecords');
    Route::get('/account/orders', 'ApplicationController@accountOrders');
    Route::get('/support', 'ApplicationController@support');
    Route::get('/support/faq', 'ApplicationController@supportFaq');
    Route::get('/suport/gonggao', 'ApplicationController@supportGonggao');
    Route::get('/support/service', 'ApplicationController@supportService');
    Route::any('/support/feedback', 'ApplicationController@supportFeedback');

    Route::get('/announce','ApplicationController@announce');
    Route::get('/announce/content/{id}','ApplicationController@announceContent');
//});

Route::get('/account/expand/{id}', 'ApplicationController@accountExpand');//二维码页面，但是这个二维码是扫了之后会进入到公众号对话窗口的,目前没什么用

Route::get('/administrator', 'AdministratorController@home');
Route::any('/administrator/signIn', 'AdministratorController@signIn');
Route::get('/administrator/signOut', 'AdministratorController@signOut');
Route::get('/administrator/users', 'AdministratorController@users');
Route::get('/administrator/users/export', 'AdministratorController@usersExport');
Route::get('/administrator/users/{id}/status', 'AdministratorController@statusForUser');
Route::any('/administrator/users/{id}/withhold', 'AdministratorController@withholdForUser');
Route::get('/administrator/orders', 'AdministratorController@orders');
Route::get('/administrator/orders/export', 'AdministratorController@ordersExport');
Route::get('/administrator/orders/{id}/controll', 'AdministratorController@ordersControll');
Route::get('/administrator/records', 'AdministratorController@records');
Route::get('/administrator/records/export', 'AdministratorController@recordsExport');
Route::get('/administrator/payRequests', 'AdministratorController@payRequests');
Route::get('/administrator/payRequests/export', 'AdministratorController@payRequestsExport');
Route::any('/administrator/payRequests/{id}', 'AdministratorController@payForUser');
Route::get('/administrator/withdrawRequests', 'AdministratorController@withdrawRequests');
Route::get('/administrator/withdrawRequests/export', 'AdministratorController@withdrawRequestsExport');
Route::any('/administrator/withdrawRequests/{id}', 'AdministratorController@withdrawForUser');
Route::any('/administrator/withdrawRequests/{id}/cancel', 'AdministratorController@withdrawForUserCanceled');
Route::get('/administrator/objects', 'AdministratorController@objects');
Route::get('/administrator/feedbacks', 'AdministratorController@feedbacks');
Route::get('/administrator/administrators', 'AdministratorController@administrators');
Route::get('/administrator/orderControl', 'AdministratorController@orderControl');
/*Route::get('/administrator/orderWillWin', 'AdministratorController@orderWillWin');
Route::get('/administrator/orderWillLost', 'AdministratorController@orderWillLost');*/
Route::get('/administrator/winControl', 'AdministratorController@winControl');
Route::post('/administrator/doWinControl', 'AdministratorController@doWinControl');

Route::get('/administrator/announce','AdministratorController@announce');//公告列表  announceAdd
Route::any('/administrator/announceAdd','AdministratorController@announceAdd');
Route::any('/administrator/announceEdit/{id}','AdministratorController@announceEdit');
Route::get('/administrator/announceDel/{id}','AdministratorController@announceDel');

Route::get('/administrator/pay', 'AdministratorController@pay');//用于测试支付
Route::get('/administrator/testPaySuccess','AdministratorController@testPaySuccess');
Route::get('/administrator/testPayFailure','AdministratorController@testPayFailure');


Route::any('/api/retUrl','ApiController@retUrl');//前端返回页面
Route::any('/api/bgRetUrl','ApiController@bgRetUrl');//后端返回页面
Route::any('/api/getSign','ApiController@getSign');//后端返回页面  seem to no use 


Route::post('/api/payrequest','ApiController@payrequest');

Route::get('/api/update', 'ApiController@update');
Route::get('/api/objects', 'ApiController@objects');
Route::get('/api/objects/{id}/{period}', 'ApiController@objectsDetail');
Route::get('/api/objects/{id}/{period}/update', 'ApiController@objectsDetailUpdate');
Route::get('/api/orders/{id}', 'ApiController@ordersDetail');
Route::get('/api/fetch', 'ApiController@fetch');
Route::get('/api/compute', 'ApiController@compute');

Route::post('/api/captcha', 'ApiController@captchaCreate');
Route::post('/api/order', 'ApiController@orderCreate');//下单的时候 看涨和看跌都是这个处理
Route::get('/api/pay/{id}', 'ApiController@payRequestUpdate');


//假数据api
Route::get('/api/businessData','ApiController@businessData');
Route::get('/api/getBusinessData','ApiController@getBusinessData');



Route::any('/callbacks/wechat', 'CallbackController@listenToWechat');
Route::any('/callbacks/payments/yunpay/notify', 'CallbackController@listenToYunpay');
Route::any('/callbacks/payments/yunpay/return', 'CallbackController@listenToYunpayReturn');

Route::get('/test', 'TestController@run');







//for markets
Route::get('/money/index','MoneyController@index');
